package com.summer.web.controller;
import com.summer.pojo.User;
import com.summer.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/Register")
public class UserRegister {
    @RequestMapping("/user")
    public String register(){
        return "Register";
    }
    @Autowired
    private UserService userService;
    @PostMapping("/adduser")
    public String addUser(User user){
        System.out.println(user);
       userService.addUser(user);
       return "login";
    }
}
